package com.tuxing.draa_data.en;

import com.google.common.base.Strings;

/**
 * @author yuanshihang
 * @version 1.0
 * @className OrderLevelEnum
 * @description 基础描述:订购层级枚举
 * @date 2021/12/6 15:55
 */
public enum OrderLevelEnum {

    全库订购(1, "全库订购"),
    子库订购(2, "子库订购"),
    单本订购(3, "单本订购"),
    单刊订购(4, "单刊订购");

    private Integer value;

    private String name;

    public Integer getValue() {
        return value;
    }

    public OrderLevelEnum setValue(Integer value) {
        this.value = value;
        return this;
    }

    public String getName() {
        return name;
    }

    public OrderLevelEnum setName(String name) {
        this.name = name;
        return this;
    }

    OrderLevelEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static OrderLevelEnum getEnumByName(String name) {
        if (Strings.isNullOrEmpty(name)) {
            return null;
        }
        for (OrderLevelEnum value : OrderLevelEnum.values()) {
            if (value.name.equals(name)) {
                return value;
            }
        }
        return null;
    }
}
